<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Sybase数据库">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="vmware_gud_0018.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="vmware_gud_0021">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Sybase数据库</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="vmware_gud_0021"></a><a name="vmware_gud_0021"></a>
  <h1 class="topictitle1">Sybase数据库</h1>
  <div>
   <div class="section" id="vmware_gud_0021__section4543102195920">
    <a name="vmware_gud_0021__section4543102195920"></a><a name="section4543102195920"></a>
    <h4 class="sectiontitle">pre-freeze-script脚本</h4>
    <p>脚本内容如下：</p>
    <p>其中，sybasebd1，sybasebd2为数据库名称，一次可以同时锁定8个数据库。</p>
    <pre class="screen">#!/bin/sh
SYBASEHOME=<em><strong>Sybase数据库安装路径</strong></em>
FREEZEFILE=$SYBASEHOME"/scripts/pre-freeze-script.sql"
FREEZELOG=$SYBASEHOME"/scripts/pre-freeze-script.out"
if [ "$(id -u)" -eq "0" ]; then 
    [ -f ${FREEZEFILE} ] &amp;&amp; rm -f ${FREEZEFILE}
    [ -f ${FREEZELOG} ] &amp;&amp; rm -f ${FREEZELOG}
 
    echo "${SYBASEHOME}/OCS-15_0/bin/isql -SKPNSYBASE -U <em><strong>数据库用户名</strong></em> -P <em><strong>对应的密码</strong></em> -e -n -o ${FREEZELOG} &lt;&lt;EOF" &gt; ${FREEZEFILE}
    echo "quiesce database <strong><em>自定义锁定标签，如tag1</em></strong> hold <strong><em>sybasebd1</em></strong>,<strong><em>sybasebd2</em></strong>" &gt;&gt; ${FREEZEFILE}
    echo "go" &gt;&gt; ${FREEZEFILE}
    echo "EOF;" &gt;&gt; ${FREEZEFILE}
 
    exec su sybase -c  ${FREEZEFILE}
    [ -f ${FREEZEFILE} ] &amp;&amp; rm -f ${FREEZEFILE}
fi</pre>
   </div>
   <div class="section" id="vmware_gud_0021__section655719346595">
    <a name="vmware_gud_0021__section655719346595"></a><a name="section655719346595"></a>
    <h4 class="sectiontitle">post-thaw-script脚本</h4>
    <p>脚本内容如下：</p>
    <p>其中，sybasebd1，sybasebd2为数据库名称，一次可以同时锁定8个数据库。</p>
    <p>tag1为锁定标签，同pre-freeze-script脚本中定义的锁定标签。</p>
    <pre class="screen">#!/bin/sh
SYBASEHOME=<em><strong>Sybase数据库安装路径</strong></em>
UNFREEZEFILE=$SYBASEHOME"/scripts/post-thaw-script.sql"
UNFREEZELOG=$SYBASEHOME"/scripts/post-thaw-script.out"
if [ "$(id -u)" -eq "0" ]; then 
    [ -f ${UNFREEZEFILE} ] &amp;&amp; rm -f ${UNFREEZEFILE}
    [ -f ${UNFREEZELOG} ] &amp;&amp; rm -f ${UNFREEZELOG}
 
    echo "${SYBASEHOME}/OCS-15_0/bin/isql -SKPNSYBASE -U <em><strong>数据库用户名</strong></em> -P <em><strong>对应的密码</strong></em> -e -n -o ${UNFREEZELOG} &lt;&lt;EOF" &gt; ${UNFREEZEFILE}
    echo "quiesce database <strong><em>tag1</em></strong> release" &gt;&gt; ${UNFREEZEFILE}
    echo "go" &gt;&gt; ${UNFREEZEFILE}
    echo "EOF;" &gt;&gt; ${UNFREEZEFILE}
 
    exec su sybase -c ${UNFREEZEFILE}
    [ -f ${UNFREEZEFILE} ] &amp;&amp; rm -f ${UNFREEZEFILE}
fi</pre>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="vmware_gud_0018.html">步骤3：配置应用一致性备份脚本</a>
    </div>
   </div>
  </div>
 </body>
</html>